package cn.fourthquestion;

public class PizzaFactory {

    public void show(Pizza pizza){
        if (pizza==null){
            System.out.println("错误");
        }else if (pizza instanceof BaconPizza){
            BaconPizza baconPizza = (BaconPizza) pizza;
            baconPizza.show();
        }else if (pizza instanceof SeafoodPizza){
            SeafoodPizza seafoodPizza = (SeafoodPizza)pizza;
            seafoodPizza.show();
        }

    }
}
